package com.wishu.finance.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * @TableName t_jr_factoring_detail
 */
@TableName(value = "t_jr_factoring_detail")
@Data
public class TJrFactoringDetail implements Serializable {
    /**
     * 主键id
     */
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 租约保理申请ID
     */
    private Long factoringId;

    /**
     * 商户id
     */
    private Long businessId;

    /**
     * 出房合同ID
     */
    private Long cfContractId;

    /**
     * 房产编号
     */
    private String houseId;

    /**
     * 房产信息(考虑在房产表中增加house_name，然后带出)
     */
    private String houseName;

    /**
     * 房源ID
     */
    private String roomId;

    /**
     * 房源编号
     */
    private String roomCode;

    /**
     * 房源名称
     */
    private String roomName;

    /**
     * 租客ID
     */
    private Long tenantId;

    /**
     * 租客姓名
     */
    private String tenantName;

    /**
     * 租客手机号
     */
    private String tenantPhone;

    /**
     * 应收租约金额
     */
    private BigDecimal shouldMonthRent;

    /**
     * 保理授信额度
     */
    private BigDecimal factoringCreditMoney;

    /**
     * 保理利息
     */
    private BigDecimal factoringInterest;

    /**
     * 服务费
     */
    private BigDecimal serviceFee;

    /**
     * 借款周期(多少个月 = 付几 * 剩余未付房租账期数)
     */
    private Integer factoringPeriod;

    /**
     * 借款账期开始日
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date borrowedStart;

    /**
     * 借款账期截止日
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date borrowedEnd;

    /**
     * 预留字段1
     */
    private BigDecimal reserve1;

    /**
     * 预留字段2
     */
    private Integer reserve2;

    /**
     * 预留字段3
     */
    private String reserve3;

    /**
     * 预留字段4
     */
    private String reserve4;

    /**
     * 预留字段5
     */
    private String reserve5;

    /**
     * 删除标识（0：未删除）（1：删除）
     */
    private Integer delFlg;

    /**
     * 创建用户id
     */
    private Long createUserid;

    /**
     * 创建时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date createTime;

    /**
     * 更新用户id
     */
    private Long updateUserid;

    /**
     * 更新用户时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date updateTime;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        TJrFactoringDetail other = (TJrFactoringDetail) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
                && (this.getFactoringId() == null ? other.getFactoringId() == null : this.getFactoringId().equals(other.getFactoringId()))
                && (this.getBusinessId() == null ? other.getBusinessId() == null : this.getBusinessId().equals(other.getBusinessId()))
                && (this.getCfContractId() == null ? other.getCfContractId() == null : this.getCfContractId().equals(other.getCfContractId()))
                && (this.getHouseId() == null ? other.getHouseId() == null : this.getHouseId().equals(other.getHouseId()))
                && (this.getHouseName() == null ? other.getHouseName() == null : this.getHouseName().equals(other.getHouseName()))
                && (this.getRoomId() == null ? other.getRoomId() == null : this.getRoomId().equals(other.getRoomId()))
                && (this.getRoomCode() == null ? other.getRoomCode() == null : this.getRoomCode().equals(other.getRoomCode()))
                && (this.getRoomName() == null ? other.getRoomName() == null : this.getRoomName().equals(other.getRoomName()))
                && (this.getTenantId() == null ? other.getTenantId() == null : this.getTenantId().equals(other.getTenantId()))
                && (this.getTenantName() == null ? other.getTenantName() == null : this.getTenantName().equals(other.getTenantName()))
                && (this.getTenantPhone() == null ? other.getTenantPhone() == null : this.getTenantPhone().equals(other.getTenantPhone()))
                && (this.getShouldMonthRent() == null ? other.getShouldMonthRent() == null : this.getShouldMonthRent().equals(other.getShouldMonthRent()))
                && (this.getFactoringCreditMoney() == null ? other.getFactoringCreditMoney() == null : this.getFactoringCreditMoney().equals(other.getFactoringCreditMoney()))
                && (this.getFactoringInterest() == null ? other.getFactoringInterest() == null : this.getFactoringInterest().equals(other.getFactoringInterest()))
                && (this.getServiceFee() == null ? other.getServiceFee() == null : this.getServiceFee().equals(other.getServiceFee()))
                && (this.getFactoringPeriod() == null ? other.getFactoringPeriod() == null : this.getFactoringPeriod().equals(other.getFactoringPeriod()))
                && (this.getBorrowedStart() == null ? other.getBorrowedStart() == null : this.getBorrowedStart().equals(other.getBorrowedStart()))
                && (this.getBorrowedEnd() == null ? other.getBorrowedEnd() == null : this.getBorrowedEnd().equals(other.getBorrowedEnd()))
                && (this.getReserve1() == null ? other.getReserve1() == null : this.getReserve1().equals(other.getReserve1()))
                && (this.getReserve2() == null ? other.getReserve2() == null : this.getReserve2().equals(other.getReserve2()))
                && (this.getReserve3() == null ? other.getReserve3() == null : this.getReserve3().equals(other.getReserve3()))
                && (this.getReserve4() == null ? other.getReserve4() == null : this.getReserve4().equals(other.getReserve4()))
                && (this.getReserve5() == null ? other.getReserve5() == null : this.getReserve5().equals(other.getReserve5()))
                && (this.getDelFlg() == null ? other.getDelFlg() == null : this.getDelFlg().equals(other.getDelFlg()))
                && (this.getCreateUserid() == null ? other.getCreateUserid() == null : this.getCreateUserid().equals(other.getCreateUserid()))
                && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
                && (this.getUpdateUserid() == null ? other.getUpdateUserid() == null : this.getUpdateUserid().equals(other.getUpdateUserid()))
                && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getFactoringId() == null) ? 0 : getFactoringId().hashCode());
        result = prime * result + ((getBusinessId() == null) ? 0 : getBusinessId().hashCode());
        result = prime * result + ((getCfContractId() == null) ? 0 : getCfContractId().hashCode());
        result = prime * result + ((getHouseId() == null) ? 0 : getHouseId().hashCode());
        result = prime * result + ((getHouseName() == null) ? 0 : getHouseName().hashCode());
        result = prime * result + ((getRoomId() == null) ? 0 : getRoomId().hashCode());
        result = prime * result + ((getRoomCode() == null) ? 0 : getRoomCode().hashCode());
        result = prime * result + ((getRoomName() == null) ? 0 : getRoomName().hashCode());
        result = prime * result + ((getTenantId() == null) ? 0 : getTenantId().hashCode());
        result = prime * result + ((getTenantName() == null) ? 0 : getTenantName().hashCode());
        result = prime * result + ((getTenantPhone() == null) ? 0 : getTenantPhone().hashCode());
        result = prime * result + ((getShouldMonthRent() == null) ? 0 : getShouldMonthRent().hashCode());
        result = prime * result + ((getFactoringCreditMoney() == null) ? 0 : getFactoringCreditMoney().hashCode());
        result = prime * result + ((getFactoringInterest() == null) ? 0 : getFactoringInterest().hashCode());
        result = prime * result + ((getServiceFee() == null) ? 0 : getServiceFee().hashCode());
        result = prime * result + ((getFactoringPeriod() == null) ? 0 : getFactoringPeriod().hashCode());
        result = prime * result + ((getBorrowedStart() == null) ? 0 : getBorrowedStart().hashCode());
        result = prime * result + ((getBorrowedEnd() == null) ? 0 : getBorrowedEnd().hashCode());
        result = prime * result + ((getReserve1() == null) ? 0 : getReserve1().hashCode());
        result = prime * result + ((getReserve2() == null) ? 0 : getReserve2().hashCode());
        result = prime * result + ((getReserve3() == null) ? 0 : getReserve3().hashCode());
        result = prime * result + ((getReserve4() == null) ? 0 : getReserve4().hashCode());
        result = prime * result + ((getReserve5() == null) ? 0 : getReserve5().hashCode());
        result = prime * result + ((getDelFlg() == null) ? 0 : getDelFlg().hashCode());
        result = prime * result + ((getCreateUserid() == null) ? 0 : getCreateUserid().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getUpdateUserid() == null) ? 0 : getUpdateUserid().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", factoringId=").append(factoringId);
        sb.append(", businessId=").append(businessId);
        sb.append(", cfContractId=").append(cfContractId);
        sb.append(", houseId=").append(houseId);
        sb.append(", houseName=").append(houseName);
        sb.append(", roomId=").append(roomId);
        sb.append(", roomCode=").append(roomCode);
        sb.append(", roomName=").append(roomName);
        sb.append(", tenantId=").append(tenantId);
        sb.append(", tenantName=").append(tenantName);
        sb.append(", tenantPhone=").append(tenantPhone);
        sb.append(", shouldMonthRent=").append(shouldMonthRent);
        sb.append(", factoringCreditMoney=").append(factoringCreditMoney);
        sb.append(", factoringInterest=").append(factoringInterest);
        sb.append(", serviceFee=").append(serviceFee);
        sb.append(", factoringPeriod=").append(factoringPeriod);
        sb.append(", borrowedStart=").append(borrowedStart);
        sb.append(", borrowedEnd=").append(borrowedEnd);
        sb.append(", reserve1=").append(reserve1);
        sb.append(", reserve2=").append(reserve2);
        sb.append(", reserve3=").append(reserve3);
        sb.append(", reserve4=").append(reserve4);
        sb.append(", reserve5=").append(reserve5);
        sb.append(", delFlg=").append(delFlg);
        sb.append(", createUserid=").append(createUserid);
        sb.append(", createTime=").append(createTime);
        sb.append(", updateUserid=").append(updateUserid);
        sb.append(", updateTime=").append(updateTime);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}